package serviceImpl;

import java.util.ArrayList;

import dao.BackCollegeDao;
import daoImpl.BackCollegeDaoImpl;
import pojo.College;
import service.BackCollegeService;

public class BackCollegeServiceImpl implements BackCollegeService{

	@Override
	public ArrayList<College> getCollege() {
		BackCollegeDao bcd = new BackCollegeDaoImpl();
		ArrayList<College> cList = bcd.getCollege();
		return cList;
	}

	@Override
	public boolean addCollege(int cProvince, String cName, String cLogo) {
		BackCollegeDao bcd = new BackCollegeDaoImpl();
		int row = bcd.addCollege(cProvince,cName,cLogo);
		return row>0 ? true : false;
	}

	@Override
	public boolean modifyCollege(int collegeid, String collegeName, int collegeProvince, String collegeLogo) {
		BackCollegeDao bcd = new BackCollegeDaoImpl();
		int row = bcd.modifyCollege(collegeid,collegeName,collegeProvince,collegeLogo);
		return row>0 ? true : false;
	}

	@Override
	public boolean delCollege(int collegeid) {
		BackCollegeDao bcd = new BackCollegeDaoImpl();
		int row = bcd.delCollege(collegeid);
		return row>0 ? true : false;
	}

}
